<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateIntegralsTable extends Migration
{
    private $table = 'integrals';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create($this->table, function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 20)->comment('巡赛名称');
            $table->string('image', 255)->comment('巡赛图片');
            $table->string('map_id',255)->comment('地图id');
            $table->unsignedInteger('win_coin')->default(0)->comment('奖励金币数');
            $table->unsignedInteger('win_diamond')->default(0)->comment('奖励钻石数');
            $table->unsignedInteger('entry_fee')->default(0)->comment('入场费');
            $table->unsignedInteger('upgrade_need')->default(0)->comment('升级需要的赢取数');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `{$this->table}` COMMENT '积分赛记录表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists($this->table);
    }
}
